<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/ext3/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/ext3/ext-all.js"></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/ext3/resources/css/ext-all.css">
		<script>
		
		String.prototype.endWith=function(str){
		if(str==null||str==""||this.length==0||str.length>this.length)
			return false;
		if(this.substring(this.length-str.length)==str)
			return true;
		else
			return false;
		return true;
		}
	
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				         {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-', 
				        {
				            text: '确定',
				            icon:"<%=contextPath%>/images/new-save.gif",
				            handler:save
				        },'-', 
				        {
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:del,
				            hidden:<%=session.getAttribute("btn_deletegzpjl_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-', 
				        {
				            text: '关闭',
				            icon:"<%=contextPath%>/images/banjie.png",
				            handler:function () {
				            	window.close();
				            }
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
	<div id = "tbar" style="position:absolute;display:block left:0px; top:0px; width:100%; height:35px; z-index:1;"></div>
	<br>
	<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		<form id="frmM"   name="frmM" method="POST" >

			<hr>
			<table width="100%" id="listtab">
				<tr>
					<th   width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</th>
					<th width="150">业务模块</th>
					<th>待办任务</th>
				</tr>

				<c:forEach items="${DBRWDLIST}" var="detail" varStatus="status">
					<tr>
						<td  width="25">
							<input type="checkbox" name="id" value="${status.index}" />
						</td>
						<td width="150">
							<a href="#" onClick="javascript:setParentOne('<c:out value="${status.index}"/>')" />
						<c:choose>
							<c:when test="${detail.model == '0'}">巡视情况  </c:when>
							<c:when test="${detail.model == '1'}">巡视情况  </c:when>
							<c:when test="${detail.model == '2'}">工作预告</c:when>
							<c:when test="${detail.model == '3'}">工作票许可、 终结</c:when>
							<c:when test="${detail.model == '4'}">工作票终结</c:when>
							<c:when test="${detail.model == '5'}">倒闸操作预告</c:when>
							<c:when test="${detail.model == '6'}">倒闸操作</c:when>
							<c:when test="${detail.model == '7'}">高频通道测试</c:when>
							<c:when test="${detail.model == '8'}">工作任务</c:when>
							<c:when test="${detail.model == '9'}">设备缺陷</c:when>
							<c:when test="${detail.model == 'A'}">设备试验轮换情况</c:when>
							<c:when test="${detail.model == 'B'}">钥匙使用</c:when>
							<c:when test="${detail.model == 'C'}">上级工作安排</c:when>
							<c:when test="${detail.model == 'D'}">周安全活动情况</c:when>
						</c:choose>
							</a>
						</td>
						<td ><c:out value="${detail.gzrw}"/></td>
					</tr>
				</c:forEach>
			</table>
		</form>
		</div>
	</body>
</html>
<script language="javascript">

			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/gzrwDbList!getList.do?page=1&c=c";
				document.frmM.submit();
			}
			
			// 单选设置父窗体短语
			function setParentOne(ids) {
			
				window.opener.saveRwd(ids);
				window.close();	
			}
			// 单选设置父窗体短语delete
			function setParentdeleteOne(ids) {
			
				window.opener.deleteRwd(ids);
				window.close();	
			}
			//
			function save() {
	
				var ids = getCheckValueMany("id")
				
				 if (ids.endWith(",")) {
 					ids = ids.substring(0,ids.length-1);
 				}
				window.opener.saveRwd(ids);
				window.close();	
			}
           function del() {
	
				var ids = getCheckValueMany("id")
				
				 if (ids.endWith(",")) {
 					ids = ids.substring(0,ids.length-1);
 				}
				window.opener.deleteRwd(ids);
				window.close();	
			}

		</script>